#define _CRT_SECURE_NO_WARNINGS 1


#include<vector>
#include<iostream>

using namespace std;

int Func(int n)
{
	int count = 0;
	while (n)
	{
		count++;
		n /= 10;
	}
	return count;
}

int SingleDigitNumber(vector<int>& v)
{
	int sum = 0;
	for (auto& e : v)
	{
		if (Func(e) == 1)
		{
			sum += e;
		}
	}
	return sum;
}

int TwoDigitNumber(vector<int>& v)
{
	int sum = 0;
	for (auto& e : v)
	{
		if (Func(e) == 2)
		{
			sum += e;
		}
	}
	return sum;
}

bool canAliceWin(vector<int>& nums)
{
	int sum1 = 0, sum2 = 0;
	for (auto& e : nums)
	{
		if (Func(e) != 1)
		{
			sum1 += e;
		}
	}
	for (auto& e : nums)
	{
		if (Func(e) != 2)
		{
			sum2 += e;
		}
	}
	if (SingleDigitNumber(nums) > sum1)
	{
		return true;
	}
	else if (TwoDigitNumber(nums) > sum2)
	{
		return true;
	}
	return false;
}

//int main()
//{
//	vector<int> v = { 5,5,5,25 };
//	cout << canAliceWin(v) << endl;
//
//	return 0;
//}